import { createApp } from 'vue'


import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn'

// svg图标
import 'virtual:svg-icons-register'
import elementIcons from '@/components/SvgIcon/svgicon'

import '@/assets/style/index.scss' // 全局样式表
import './assets/style/tailwind.css' // 样式插件

// 视频播放
import Vue3VideoPlayer from '@cloudgeek/vue3-video-player'
import '@cloudgeek/vue3-video-player/dist/vue3-video-player.css'

import SvgIcon from '@/components/SvgIcon'
import RightToolbar from '@/components/RightToolbar'
import Pagination from '@/components/Pagination'
import DictTag from '@/components/DictTag'
import Editor from '@/components/Editor'
import FileUpload from '@/components/FileUpload'
import ImageUpload from '@/components/ImageUpload'
import ImagePreview from '@/components/ImagePreview'

import App from './App'
import store from './store'
import router from './router'
import Cookies from "js-cookie";
import directive from "@/directive";

// 定义特性标志 - 消除一个烦人的控制台警告
window.__VUE_PROD_DEVTOOLS__ = false;
window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;

const app = createApp(App)

// 全局方法挂载
app.config.globalProperties.parseTime = parseTime

// 全局组件挂载
app.component('RightToolbar', RightToolbar)
app.component('Pagination', Pagination)
app.component('svg-icon', SvgIcon)
app.component('DictTag', DictTag)
app.component('Editor', Editor)
app.component('FileUpload', FileUpload)
app.component('ImageUpload', ImageUpload)
app.component('ImagePreview', ImagePreview)
// 使用element-plus 并且设置全局的大小
app.use(ElementPlus, {
    locale: locale,
    // 支持 large、default、small
    size: Cookies.get('size') || 'default'
})

app.use(Vue3VideoPlayer, {
    lang: 'zh-CN'
})

app.use(router) //懂得都懂
app.use(store) //懂得都懂
app.use(elementIcons) // elementPlus提供的icon组件包

// 注册自定义指令
directive(app)

app.mount('#app')
